﻿@model BLL.Model.Base.Login
@{
    ViewBag.Titile = "欢迎使用蔚云云管理平台";
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Titile</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/ez_css.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/jqueryui/cupertino/jquery-ui.css")" rel="stylesheet"
          type="text/css" />
    <style type="text/css">
        html
        {
            height: 100%;
        }
        
        body
        {
            height: 100%;
            min-height: 610px;
            margin: 0px;
            font-family: Verdana, Arial, Geneva, Helvetica, sans-serif;
            font-size: 12px;
            color: #333333;
            position: relative;
            line-height: 1.2em;
            background-color: #dfeff9;
        }
        .search_input
        {
            width: 230px;
            height: 22px;
            padding: 4px 0 0 2px;
            border-width: 1px;
            margin-right: 5px;
            border-style: solid;
            font-size: 16px;
            border-color: #69C;
            background: white;
        }
    </style>
    <script src="@Url.Content("~/Scripts/jquery-1.7.2.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jqueryui/jquery-ui.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $().ready(function () {
            var dialog = $("#divLogin").dialog({
                width: 480,
                height: 280,
                modal: true,
                draggable: false,
                resizable: false,
                resize: "auto",
                open: function () {
                    $(".ui-dialog-titlebar-close").hide();
                }
            });

            dialog.parent().appendTo($("form"));

            $("#imgValidateCode").click(function () {
                var url = "/account/validatecode/?time=" + new Date().getMilliseconds();
                $(this).attr("src", url);
            }).trigger("click");

            $(":submit").button();

            showMessage();

            autoLogin();

            $("#UserName").focus();
        });

        function showMessage() {
            var message = '@ViewBag.ErrorMessage';
            if (message) {
                alert(message);
            }
        }

        function autoLogin() {
            $("#UserName").val("admin");
            $("#Password").val("123");
            $("#ValidateCode").val("123");
        }

    </script>
</head>
<body>
    @using (Html.BeginForm("CheckLogin", "Account"))
    {
        <div id="divLogin" title="@ViewBag.Titile">
            <div class="ez-wr" style="text-align: left; margin-top: 20px;">
                <div class="ez-box" style="margin: 10px;">
                    <div class="ez-wr">
                        <div class="ez-fl ez-negmr ez-15" style="margin: 5px;">
                            <div class="ez-box">
                                @Html.LabelFor(p => p.UserName)：
                            </div>
                        </div>
                        <div class="ez-last ez-oh">
                            <div class="ez-box">
                                @Html.TextBoxFor(p => p.UserName, new { @class = "search_input", @maxlength = "20" })
                                <em>@Html.ValidationMessageFor(p => p.UserName)</em>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="ez-box" style="margin: 10px;">
                    <div class="ez-wr">
                        <div class="ez-fl ez-negmr ez-15" style="margin: 5px;">
                            <div class="ez-box">
                                @Html.LabelFor(p => p.Password)：
                            </div>
                        </div>
                        <div class="ez-last ez-oh">
                            <div class="ez-box">
                                @Html.PasswordFor(p => p.Password, new { @class = "search_input", @maxlength = "20" })
                                <em>
                                    @Html.ValidationMessageFor(p => p.Password)
                                </em>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="ez-box" style="margin: 10px;">
                    <div class="ez-wr">
                        <div class="ez-fl ez-negmr ez-15" style="margin: 5px;">
                            <div class="ez-box">
                                @Html.LabelFor(p => p.ValidateCode)：
                            </div>
                        </div>
                        <div class="ez-last ez-oh">
                            <div class="ez-box">
                                @Html.TextBoxFor(p => p.ValidateCode, new { @class = "search_input", @style = "width:100px;", @maxlength = "4" })
                                <img alt="点击刷新" src="#" id="imgValidateCode" align="absmiddle" />
                                <em style="margin-left: 35px;">
                                    @Html.ValidationMessageFor(p => p.ValidateCode)
                                </em>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <p style="margin-top: 50px;">
                <input type="submit" value="登 录" />&nbsp;&nbsp;&nbsp;&nbsp; <a href="/register/"
                    style="color: blueviolet;" id="btnRegister">注册新用户</a>
            </p>
        </div>
    }
</body>
</html>
